package com.fivebrms.business
{
	import org.osflash.thunderbolt.Logger;
	
	import com.fivebrms.model.MainModelLocator;
	import com.fivebrms.vo.ConfidentialityVO;
	
	import com.adobe.cairngorm.business.ServiceLocator;
	import com.adobe.cairngorm.business.Responder;
	import com.adobe.cairngorm.commands.Command;
	import com.adobe.cairngorm.control.CairngormEvent;
	import mx.controls.Alert;
	import flash.net.FileFilter;
    import flash.net.Responder;
   	import mx.rpc.AsyncToken;
   	import mx.rpc.IResponder;

	
	public class ConfidentialityDelegate
	{
		//
		// store user control references to the model
		//
		private var model : MainModelLocator = MainModelLocator.getInstance();
		private var responder : IResponder;
		private var service : Object;
		
		public function ConfidentialityDelegate( responder : IResponder )
		{
			Logger.info("setting the ConfidentialityDelegate iresponder.in the delegate..");
			this.responder = responder;
			
			Logger.info("getting the ConfidentialityDelegate service..");
            this.service = ServiceLocator.getInstance().getRemoteObject("confidSrv")
			Logger.info("got the ConfidentialityDelegate service..");
		}
		
		public function submitConfidentialityForm( form : ConfidentialityVO ) : void
		{
			var token : AsyncToken;
			
			Logger.info("start ConfidentialityDelegate delegate remote call..");
			token = this.service.submitConfidentialityForm(form);
			
			Logger.info("add LoginDelegate responder ..");
			token.addResponder( this.responder );
			
			Logger.info("login - finished calling delegate..");
		}
	}
}
